
cc.Class({
    extends: cc.Component,

    properties: {
        nodeSprite:{
            default:null,
            type:cc.Sprite
        }
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
    },

    start () {

    },

    // update (dt) {},

    initDiscardPoker:function (pokerObj) {
        let path
        if(!pokerObj){
            path = "poker_back"
        }else {
            let pokerId = pokerObj.poker
            path = cc.gg.resUtil.getPokerFramePath(pokerId)
        }

        cc.loader.loadRes("pokers/"+path,cc.SpriteFrame,function (err, frame) {
            if(err){
                cc.error(err)
                return
            }

            this.nodeSprite.spriteFrame = frame
        }.bind(this))
    }


});
